<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    {% load static %}
    <link rel="stylesheet" href="{% static '/css/bootstrap.min.css' %}">
    <script src="{% static '/js/jquery-3.2.1.min.js' %}"></script>
    <script src="{% static '/js/bootstrap.min.js' %}"></script>
    <title>登录页面</title>
    <style>
        body {
            background-color: #eee;
        }
    </style>
    <script>
        function check() {
            let username = $("#username").val();
            let password = $("#password").val();
            return !!(username && password);
        }
    </script>
</head>
<body>

<div class="container">
    <div class="row">
        <div class="col-md-4 col-md-offset-4" style="margin-top: 100px">
            <h1 class="text-center">请登录</h1>
            <form class="form-horizontal" action="" method="post" onsubmit="return check()">
                {% csrf_token %}
                <div class="form-group">
                    <div class="input-group col-md-8 col-md-offset-2">
                         <span class="input-group-addon"><label for="username">英文昵称</label> </span>
                        <input type="text" name="user" class="form-control" id="username" placeholder="username">
                    </div>
                </div>
                <div class="form-group">
                    <div class="input-group col-md-8 col-md-offset-2">
                        <span class="input-group-addon"><label for="password">输入密码</label></span>
                        <input type="password" name="pwd" class="form-control" id="password" placeholder="password">
                    </div>
                </div>
                <div class="form-group">
                    <div class="input-group col-md-offset-2 col-md-8">
                        <div class="checkbox">
                            <label>
                                <input name="rem" value="0" type="checkbox"> 记住我
                            </label>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="input-group col-md-offset-4 col-md-4">
                        <button type="submit" class="btn btn-primary btn-block">登录</button>
                        <span>{{ msg }}</span>
                    </div>
                </div>
            </form>
            <div class="form-group">
                <div class="input-group col-md-offset-4 col-md-4">
                    <a type="submit" class="btn btn-primary btn-block" href="/register/">注册</a>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>